package com.xmg.p2p.base.controller;

import com.xmg.p2p.base.domain.Logininfo;
import com.xmg.p2p.base.service.IAccountService;
import com.xmg.p2p.base.service.IUserinfoService;
import com.xmg.p2p.base.util.UserContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PersonalController {
        @Autowired
        private IAccountService accountService;

        @Autowired
        private IUserinfoService userinfoService;
        @RequestMapping("personal")
        public String personal(Model model){
            Logininfo current = UserContext.getCurrent();
            
            model.addAttribute("account",accountService.get(current.getId()));
            model.addAttribute("userinfo",userinfoService.get(current.getId()));
            return "personal";
        }
}
